﻿using System;
using System.Collections.Generic;
using System.Text;
using XhPaper.基本图形;

namespace XhPaper
{
    public class MyTableDy : MyTableBase
    {
        MyDuanZi[] Dz = new MyDuanZi[5];
        string[] str=new string[]{"+12V","GND","-12V","Jz220","Jf220"};
        public MyDuanZi[] Dz1
        {
            get { return Dz; }
            //set { Dz = value; }
        }
         public MyTableDy()
        {

        }
        public MyTableDy(double left, double top, MyAutoCadObjectBase container)
            :base(left + container.Left, container.Top+top, container)
        {
            ITable = new MyXmlTabledyMini();
            m_HangLines = ITable.GetHangLines(this);
            m_LieLines = ITable.GetLieLines(this);
            ITable.GetNameTextDic(this, out m_TableNameDic, out m_TableTextDic);
            for (int i = 0; i < 5; i++)
            {
                MyPoint p1;
                p1 = m_HangLines[1].P1.inflate(25, -(14 + i * 10));
                MyText text=new MyText(p1,str[i],this);
                Dz[i] = new MyDuanZi(p1, text, this);
                if (i >= 3)
                {
                    p1 = m_HangLines[0].P1.inflate(7 + 8 * (i - 3), 7);
                    text = new MyText(p1, str[i], this);
                    text.IsHorizontal = false;
                    Dz[i] = new MyDuanZi(p1, text, this);
                }
            }
        }
        public override void MyDraw(MyCadDll.MyCad mycad)
        {
            base.MyDraw(mycad);
            for (int i = 0; i < Dz.Length; i++)
            {
                Dz[i].MyDraw(mycad);
            }
        }
    }
}
